package com.example.gank.adapter;

import android.content.Context;

import com.android.core.base.BaseRcvAdapter;
import com.android.core.base.BaseViewHolder;
import com.example.gank.R;
import com.example.gank.bean.AndroidGankBean;

import java.util.List;

/**
 * Created by bsx on 17-1-11.
 */

public class AndroidGankAdapter<T> extends BaseRcvAdapter<BaseViewHolder, T> {

    public AndroidGankAdapter(Context context, int layoutId, List mList) {
        super(context, layoutId, mList);
    }

    @Override
    public void convert(BaseViewHolder holder, Object object) {
        AndroidGankBean androidGankBean = (AndroidGankBean) object;
        holder.setText(R.id.tv_title, androidGankBean.getDesc());
        List<String> images = androidGankBean.getImages();
        if (images != null && !images.isEmpty()) {
            holder.setImageView(R.id.iv_cover, images.get(0));
        }

    }

}
